package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import protobuf.E_BET_POOL_CAUSE;
	import protobuf.BET_POOL;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class MSPKG_BET_POOL_NTF extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const BET_POOL:RepeatedFieldDescriptor$TYPE_MESSAGE = new RepeatedFieldDescriptor$TYPE_MESSAGE("protobuf.MSPKG_BET_POOL_NTF.bet_pool", "betPool", (1 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.BET_POOL);

		[ArrayElementType("protobuf.BET_POOL")]
		public var betPool:Array = [];

		/**
		 *  @private
		 */
		public static const TABLE_ID:FieldDescriptor$TYPE_UINT64 = new FieldDescriptor$TYPE_UINT64("protobuf.MSPKG_BET_POOL_NTF.table_id", "tableId", (2 << 3) | com.netease.protobuf.WireType.VARINT);

		public var tableId:UInt64;

		/**
		 *  @private
		 */
		public static const CAUSE:FieldDescriptor$TYPE_ENUM = new FieldDescriptor$TYPE_ENUM("protobuf.MSPKG_BET_POOL_NTF.cause", "cause", (3 << 3) | com.netease.protobuf.WireType.VARINT, protobuf.E_BET_POOL_CAUSE);

		private var cause$field:int;

		private var hasField$0:uint = 0;

		public function clearCause():void {
			hasField$0 &= 0xfffffffe;
			cause$field = new int();
		}

		public function get hasCause():Boolean {
			return (hasField$0 & 0x1) != 0;
		}

		public function set cause(value:int):void {
			hasField$0 |= 0x1;
			cause$field = value;
		}

		public function get cause():int {
			return cause$field;
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			for (var betPool$index:uint = 0; betPool$index < this.betPool.length; ++betPool$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 1);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, this.betPool[betPool$index]);
			}
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 2);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT64(output, this.tableId);
			if (hasCause) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_ENUM(output, cause$field);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var table_id$count:uint = 0;
			var cause$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					this.betPool.push(com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, new protobuf.BET_POOL()));
					break;
				case 2:
					if (table_id$count != 0) {
						throw new flash.errors.IOError('Bad data format: MSPKG_BET_POOL_NTF.tableId cannot be set twice.');
					}
					++table_id$count;
					this.tableId = com.netease.protobuf.ReadUtils.read$TYPE_UINT64(input);
					break;
				case 3:
					if (cause$count != 0) {
						throw new flash.errors.IOError('Bad data format: MSPKG_BET_POOL_NTF.cause cannot be set twice.');
					}
					++cause$count;
					this.cause = com.netease.protobuf.ReadUtils.read$TYPE_ENUM(input);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
